﻿@model IEnumerable<TracNghiem.Areas.Admin.Models.BaiThiModel>
          
<div align="center">
    <h1>
        BÁO CÁO TRẮC NGHIỆM TỔNG HỢP</h1>
</div>
<div class="container_12">
    <div class="grid_12">
        
        @using (Html.BeginForm("FindReport", "Report", FormMethod.Post, new { id = "FindReport", name = "FindReport" }))
        {
            <div style="padding-left: 5px; margin-bottom: 5px; text-align: left; width: 40%">
                <lable style="margin-right: 3px">Dịch vụ: </lable>
                @*@if (ViewBag.dichvu_id != null)
                {                               
                    @Html.DropDownList("service_id", ViewBag.dichvu_id as SelectList, "---Chọn dịch vụ---", new { style = "margin-left:17px" })          
                }*@
                <select id="service_id" name="service_id" style="margin-left: 17px">
                    @Html.Raw(ViewBag.theanh);
                </select>
            </div>
            <p style="text-align: left; width: 40%; padding-left: 5px">
                Đề thi:&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                @if (ViewBag.test_id == null)
                {    
                    @Html.DropDownList("de_thi_id", Enumerable.Empty<SelectListItem>(), "---Chọn đề thi---")
                }
                else
                {
                    @Html.DropDownList("de_thi_id", ViewBag.test_id as SelectList, "---Chọn đề thi---")
                }
            </p> 
            <div class="bottom-spacing">
                <input class="submit-green" type="submit" value="Tìm kiếm" style="width: 8.5%; padding-left: 3px" />
            </div> 
            <div class="bottom-spacing">
                
                <a href="@Url.Action("Export_Excel", "Report")">Export Excel</a>
            </div>
        }
        <div class="module">
            <h2>
                <span></span>
            </h2>
            <div class="module-table-body">
                <div class="scrolling">
                    <div class="data-table" style="width: 120%">
                        <table id="myTable" class="tablesorter">
                            <thead>
                                <tr>
                                    <th style="width: 5%">
                                        STT
                                    </th>
                                    <th style="width: 15%">
                                        Trung tâm
                                    </th>
                                    <th style="width: 15%">
                                        Tên đăng nhập
                                    </th>
                                    <th style="width: 15%">
                                        Họ tên
                                    </th>
                                    <th style="width: 20%">
                                        Đề thi
                                    </th>
                                    <th style="width: 10%">
                                        Ngày
                                    </th>
                                    <th style="width: 10%">
                                        Lần thi
                                    </th>
                                    <th style="width: 10%">
                                        Câu đúng
                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                @{int stt = 0;}
                                @foreach (var item in Model)
                                {
                                    stt++;                                         
                                        
                                    <tr onclick="location.href='@Url.Action("Detail", "Report", new { user_id = @item.user_id, lan_thi = @item.lan_thi, de_thi_id = @item.de_thi_id, user_name = @item.user_name, ho_ten = @item.ho_ten, don_vi = @item.don_vi, ngay_thi = @item.ngay_thi })'" style="cursor:pointer;">
                                        <td class="align-center" style="color:Blue">@stt
                                        </td>
                                        <td style="color:Blue">@Html.DisplayFor(modelItem => item.don_vi)
                                        </td>
                                        <td style="color:Blue">@Html.DisplayFor(modelItem => item.user_name)
                                        </td>
                                        <td style="color:Blue">@Html.DisplayFor(modelItem => item.ho_ten)
                                        </td>
                                        <td style="color:Blue">@Html.DisplayFor(modelItem => item.ten_de_thi)
                                        </td>
                                        <td style="color:Blue" >@Html.DisplayFor(modelItem => item.ngay_thi)
                                        </td>
                                        <td style="color:Blue">@Html.DisplayFor(modelItem => item.lan_thi)
                                        </td>
                                        <td style="color:Blue">@(item.cau_dung)/@(item.tong_so_cau)
                                        </td>
                                    </tr>
                                }
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="pager" id="pager">
                    <form action="">
                    <div>
                        <img class="first" src="@Url.Content("~/Areas/Admin/Content/themes/template/image/arrow-stop-180.gif")"/>
                        <img class="prev" src="@Url.Content("~/Areas/Admin/Content/themes/template/image/arrow-180.gif")"/>
                        <input type="text" class="pagedisplay input-short align-center" />
                        <img class="next" src="@Url.Content("~/Areas/Admin/Content/themes/template/image/arrow.gif")"/>
                        <img class="last" src="@Url.Content("~/Areas/Admin/Content/themes/template/image/arrow-stop.gif")"/>
                        <select class="pagesize input-short align-center">
                            <option value="10" selected="selected">10</option>
                            <option value="20">20</option>
                            <option value="30">30</option>
                            <option value="40">40</option>
                        </select>
                    </div>
                    </form>
                </div>
                <div style="clear: both">
                </div>
            </div>
            <!-- End .module-table-body -->
        </div>
        <!-- End .module -->
    </div>
    <!-- End .grid_12 -->
</div>
<!-- End .container_12 -->
<script type="text/javascript">
    $("#service_id").change(function () {
        $.ajax({
            type: "POST",
            url: '@Url.Action("getDVJson", "Report")',
            data: { dichvu_id: $("#service_id > option:selected").attr("value"), Order: "ID" },
            success: function (data) {
                var items = [];
                items.push("<option>---Chọn đề thi---</option>");
                $.each(data, function () {
                    items.push("<option value=" + this.Value + ">" + this.Text + "</option>");
                });
                $("#de_thi_id").html(items.join(' '));
            }
        })
    });
</script>
<script type="text/javascript">
    function goTo()
    {
        
    }
</script>
